"""文章，文章分类，文章评论"""
from datetime import datetime
from pydantic import BaseModel


class NewsBase(BaseModel):   # 与数据库表响应
    ne_id: int
    ne_title: str
    ne_author: str
    ne_content: str
    ne_date: datetime
    nety_id: int
    created_at: datetime
    updated_at: datetime


class NewsCreate(NewsBase):
    ne_title: str
    ne_author: str
    ne_content: str
    ne_date: datetime
    nety_id: int


class NewsRead(NewsBase):
    ne_title: str
    ne_author: str
    ne_content: str
    ne_date: datetime


class NewsUpdate(NewsBase):
    ne_title: str
    ne_author: str
    ne_content: str
    ne_date: datetime
    nety_id: int


class NewsDelete(NewsBase):
    pass

    class Config:
        """兼容ORM模型,为模型实例"""
        orm_mode = True


